/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author bantch01
 */
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;


public class GraphicsFrame extends JFrame 
{
    private GraphicsPanel gpanel;
    private GraphicsFrame x;

    
    public GraphicsFrame()
    {
        super();
        x = this;
        
        
        JMenuBar myMenuBar = new JMenuBar();

        JMenu fileMenu = new JMenu("File");
        myMenuBar.add(fileMenu);

        JMenuItem about = new JMenuItem("About");
        fileMenu.add(about);
        about.addActionListener(new myActionListener());
        
        JMenuItem closeF = new JMenuItem("Close");
        fileMenu.add(closeF);
        closeF.addActionListener(new myActionListener());
        
        this.setJMenuBar(myMenuBar);
        
        
        
        gpanel = new GraphicsPanel(this);
        this.setMinimumSize(new Dimension(550, 250));
        this.add(gpanel);

        setSize(550, 600);

        this.setTitle("ClientBrowser");
    
    }
    
    private class myActionListener implements ActionListener
    {
        public myActionListener()
        {
        }

        public void actionPerformed(ActionEvent ae)
        {
            if (ae.getActionCommand().equals("Close"))
            {       
                System.exit(0);
            }

            if (ae.getActionCommand().equals("Themes"))
            {
                Object[] possibilities = {"Patriotic", "Dark Night", "Purdy", "Bloody"};
                String selectedValue = (String)JOptionPane.showInputDialog(null,
                        "Please select a theme", "Themes",
                        JOptionPane.INFORMATION_MESSAGE, null, 
                        possibilities, possibilities[0]);               
                //gpanel.setTheme(selectedValue);
            }
            if (ae.getActionCommand().equals("About"))
            {
                JOptionPane.showMessageDialog(new GraphicsFrame(), "This program was made by Charles & Jacob.");
                
            }

        }
    }
}
